package com.stn.zjx.givingtreasure.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.stn.zjx.givingtreasure.table.User;
import com.stn.zjx.givingtreasure.table.WalletUser;
import com.stn.zjx.givingtreasure.table.Test;

import com.stn.zjx.givingtreasure.greendao.UserDao;
import com.stn.zjx.givingtreasure.greendao.WalletUserDao;
import com.stn.zjx.givingtreasure.greendao.TestDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userDaoConfig;
    private final DaoConfig walletUserDaoConfig;
    private final DaoConfig testDaoConfig;

    private final UserDao userDao;
    private final WalletUserDao walletUserDao;
    private final TestDao testDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        walletUserDaoConfig = daoConfigMap.get(WalletUserDao.class).clone();
        walletUserDaoConfig.initIdentityScope(type);

        testDaoConfig = daoConfigMap.get(TestDao.class).clone();
        testDaoConfig.initIdentityScope(type);

        userDao = new UserDao(userDaoConfig, this);
        walletUserDao = new WalletUserDao(walletUserDaoConfig, this);
        testDao = new TestDao(testDaoConfig, this);

        registerDao(User.class, userDao);
        registerDao(WalletUser.class, walletUserDao);
        registerDao(Test.class, testDao);
    }
    
    public void clear() {
        userDaoConfig.clearIdentityScope();
        walletUserDaoConfig.clearIdentityScope();
        testDaoConfig.clearIdentityScope();
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public WalletUserDao getWalletUserDao() {
        return walletUserDao;
    }

    public TestDao getTestDao() {
        return testDao;
    }

}
